<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><s:text name="title"/></title>
<link href="<%=request.getContextPath()%>/stage/css/inside.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/stage/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/stage/js/ajaxfileupload.js"></script>
<script type="text/JavaScript">
<!--
$(document).ready(function() {
	init();
})
function init(){
	$("#suplist").hide();
	$("#list").hide();
	var type=<%=request.getAttribute("inlayType")%>;
	if(type==2){$("#suplist").show();}else{$("#list").show();}
	$("#newOrEdit").hide();
	$("#doprice").hide();
	initInput();
}
function initInput(){
	$("#mess").html('<s:property value="tip"/>');
	$("#inlayName").val('');
	$("#k18Price").val('');
	$("#pt900Price").val('');
	$("#pt950Price").val('');
	$("#inlayNumber").val('');
	$("#k18Weight").val('');
	$("#pt900Weight").val('');
	$("#pt950Weight").val('');
	$("#factoryNumber").val('');
	$("#picture").val('');
}
function showUpInlay(){
	$("#list").hide();
	$("#suplist").hide();
	$("#newOrEdit").show();
	$("#doprice").hide();
	initInput();
}
function upinlay(){
	var inlayName=$("#inlayName").val();
	var k18Price=$("#k18Price").val();
	var pt900Price=$("#pt900Price").val();
	var pt950Price=$("#pt950Price").val();
	var inlayNumber=$("#inlayNumber").val();
	var factoryNumber=$("#factoryNumber").val();
	var k18Weight=$("#k18Weight").val();
	var pt900Weight=$("#pt900Weight").val();
	var pt950Weight=$("#pt950Weight").val();
	var thumbnailPicture=$("#thumbnailPicture").val();
	var picture=$("#picture").val();
	
	if(inlayName.length<1||k18Price.length<1||pt900Price.length<1||pt950Price.length<1||inlayNumber.length<1
			||factoryNumber.length<1||k18Weight.length<1||pt900Weight.length<1||pt950Weight.length<1||thumbnailPicture.length<1||picture.length<1){
		$("#mess").html('请填写必填字段!');
		return false;
	}

}

function showEditPrice(){
	$("#doprice").show();
}

function closeEditPrice(){
	$("#doprice").hide();
}
function saveRate(){
	var rate=$("#inlayRate").val();
	if(rate.length<1)return;
	var server ="<%=request.getContextPath()%>/editinlayrate.action?inlayRate="+rate;
	window.location.href=server;
}
function del(inlayDiaId){ 
	var server ="<%=request.getContextPath()%>/delinlaydia.action?inlayDiaId="+inlayDiaId;
	window.location.href=server;
}


//-->
</script>
</head>

<body
	onload="MM_preloadImages('<%=request.getContextPath()%>/stage/images/menu0_01.jpg','<%=request.getContextPath()%>/stage/images/menu0_02.jpg','<%=request.getContextPath()%>/stage/images/menu0_03.jpg','<%=request.getContextPath()%>/stage/images/menu0_04.jpg','<%=request.getContextPath()%>/stage/images/menu0_05.jpg','<%=request.getContextPath()%>/stage/images/menu0_06.jpg','<%=request.getContextPath()%>/stage/images/menu0_07.jpg')">
<div class="mainbody">
<%@ include file="head1.jsp"%>
 <div class="intermediate">
    <h1>当前位置：首页&nbsp;&gt;&nbsp;<b><FONT COLOR="#FFCC66">上传钻托</FONT></b></h1>
    <%@ include file="left_user.jsp"%>
     <div class="right">
      <a href="<%=request.getContextPath()%>/tomyinlaydia.action">自己的钻托</a>&nbsp;|&nbsp;<a href="<%=request.getContextPath()%>/tosupinlaydia.action">供应商钻托</a>&nbsp;|&nbsp;<a href="javascript:showEditPrice()">修改价格系数</a>&nbsp;|&nbsp;<a href="javascript:showUpInlay()">上传钻托</a>
     	<div class="right_bottom" id="doprice">
	    	<ul>
	    	<li>
	    	钻托价格系数：<input maxlength="8" name="inlayRate" id="inlayRate" value="<s:property value="inlayRate"/>" type="text" class="sous1" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))"/>
	    	&nbsp;&nbsp;<a href="javascript:saveRate()">提交</a>&nbsp;&nbsp;<a href="javascript:closeEditPrice()">关闭</a>
	    	</li>
	    	</ul>
	    </div>
     
	    <div class="right_bottom" id="list">
	    	自己的钻托
          <div class="jgkz">
	       <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr>
               <td height="30" align="center" class="xian_01">钻托名称 </td>
               <td height="30" align="center" class="xian_01">钻托编号</td>
               <td height="30" align="center" class="xian_01">工厂编号</td>
               <td height="30" align="center" class="xian_01">钻托类型</td>
               <td height="30" align="center" class="xian_01">18k重量 </td>
               <td height="30" align="center" class="xian_01">18k价格 </td>
               <td height="30" align="center" class="xian_01">pt900重量 </td>
               <td height="30" align="center" class="xian_01">pt900价格 </td>
               <td height="30" align="center" class="xian_01">pt950重量 </td>
               <td height="30" align="center" class="xian_01">pt950价格 </td>
               <td height="30" align="center" class="xian_01"> 操  作  </td>
             </tr>
             
             <s:iterator value="dataList" id="bo" status="u">
				<s:if test="#u.index%2!=0"><tr bgcolor="#2e2e2e"></s:if>
				<s:else><tr></s:else>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="inlayName"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="inlayNumber"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="factoryNumber"/></td>
               <td width="9%" height="30" align="center" class="xian_02"><s:property value="inlayType"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="k18Weight"/></td>
               <td width="9%" height="30" align="center" class="xian_02"><s:property value="k18PriceFormat"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="pt900Weight"/></td>
               <td width="9%" height="30" align="center" class="xian_02"><s:property value="pt900PriceFormat"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="pt950Weight"/></td>
               <td width="9%" height="30" align="center" class="xian_02"><s:property value="pt950PriceFormat"/></td>
               <td width="6%" align="center"><a href="javascript:del(<s:property value="inlayDiamondId"/>)">删除</a><label>
               	
               </label></td>
             </tr>
             </s:iterator>
           </table>
	    </div>
	    <div >
           <ul>
			 <li><jsp:include page="page.jsp"/></li>
           </ul>
        </div>
        </div>
        <div class="right_bottom" id="suplist">
	  		  供应商钻托
	       <div class="jgkz">
	       <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
             <tr>
               <td height="30" align="center" class="xian_01">钻托名称 </td>
               <td height="30" align="center" class="xian_01">钻托编号</td>
               <td height="30" align="center" class="xian_01">工厂编号</td>
               <td height="30" align="center" class="xian_01">钻托类型</td>
               <td height="30" align="center" class="xian_01">18k重量 </td>
               <td height="30" align="center" class="xian_01">18k成本 </td>
               <td height="30" align="center" class="xian_01">pt900重量 </td>
               <td height="30" align="center" class="xian_01">pt900成本 </td>
               <td height="30" align="center" class="xian_01">pt950重量 </td>
               <td height="30" align="center" class="xian_01">pt950成本 </td>
             </tr>
             
             <s:iterator value="dataList" id="bo" status="u">
				<s:if test="#u.index%2!=0"><tr bgcolor="#1F1F1F"></s:if>
				<s:else><tr></s:else>
               <td width="6%" height="30" align="center" class="xian_02"><s:property value="inlayName"/></td>
               <td width="9%" height="30" align="center" class="xian_02"><s:property value="inlayNumber"/></td>
               <td width="9%" height="30" align="center" class="xian_02"><s:property value="factoryNumber"/></td>
               <td width="6%" height="30" align="center" class="xian_02"><s:property value="inlayType"/></td>
               <td width="7%" height="30" align="center" class="xian_02"><s:property value="k18Weight"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="k18PriceFormat"/></td>
               <td width="7%" height="30" align="center" class="xian_02"><s:property value="pt900Weight"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="pt900PriceFormat"/></td>
               <td width="7%" height="30" align="center" class="xian_02"><s:property value="pt950Weight"/></td>
               <td width="8%" height="30" align="center" class="xian_02"><s:property value="pt950PriceFormat"/></td>
             </tr>
             </s:iterator>
           </table>
	    </div>
  		 <div >
           <ul>
			 <li><jsp:include page="page.jsp"/></li>
           </ul>
        </div>
	   </div>

	    <div class="right_bottom" id="newOrEdit">
	    <form onsubmit="return upinlay()" action="<%=request.getContextPath()%>/upinlaydia.action" method="post" enctype="multipart/form-data">
		  <ul>
			<li>
				钻托名称：  &nbsp;&nbsp; &nbsp;<span style="color:red;">* </span>
					<input maxlength="30" name="inlayDiamondBo.inlayName" id="inlayName" value="<s:property value="inlayDiamondBo.inlayName"/>" type="text" class="sous1"/>
				&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
				钻托类型：  <span style="color:red;">* </span>
				<select  id="typeselect" name="inlayDiamondBo.inlayType">  
           				<option value="女戒">女戒</option>   
           				<option value="男戒">男戒</option>
           				<option value="吊坠">吊坠</option>   
           				<option value="耳钉">耳钉</option>
           				<option value="手链">手链</option>      
        		</select>
			</li>
			<li>
				钻托编号：  &nbsp;&nbsp; &nbsp;<span style="color:red;">* </span>
					<input maxlength="50" name="inlayDiamondBo.inlayNumber" id="inlayNumber" value="<s:property value="inlayDiamondBo.inlayNumber"/>" type="text" class="sous1"/>
				&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
				工厂编号：   <span style="color:red;">* </span>
					<input maxlength="50" name="inlayDiamondBo.factoryNumber" id="factoryNumber" value="<s:property value="inlayDiamondBo.factoryNumber"/>" type="text" class="sous1"/>
			</li>
        	<br/><hr/><br/>
        	<li>
        		18 K重量：&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:red;">* </span>
        			<input maxlength="8" name="inlayDiamondBo.k18Weight" id="k18Weight" value="<s:property value="inlayDiamondBo.k18Weight"/>" type="text" class="sous1" />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				18K价格：&nbsp;&nbsp;<span style="color:red;">* </span><input maxlength="8" name="inlayDiamondBo.k18Price" id="k18Price" value="<s:property value="inlayDiamondBo.k18Price"/>" type="text" class="sous1" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))"/>
			</li>
			<li>
				PT900重量：<span style="color:red;">* </span>
					<input maxlength="8" name="inlayDiamondBo.pt900Weight" id="pt900Weight" value="<s:property value="inlayDiamondBo.pt900Weight"/>" type="text" class="sous1" />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				PT900价格：<span style="color:red;">* </span>
					<input maxlength="8" name="inlayDiamondBo.pt900Price" id="pt900Price" value="<s:property value="inlayDiamondBo.pt900Price"/>" type="text" class="sous1" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))"/>
			</li>
			<li>
				PT950重量：<span style="color:red;">* </span>
					<input maxlength="8" name="inlayDiamondBo.pt950Weight" id="pt950Weight" value="<s:property value="inlayDiamondBo.pt950Weight"/>" type="text" class="sous1" />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				PT950价格：<span style="color:red;">* </span>
					<input maxlength="8" name="inlayDiamondBo.pt950Price" id="pt950Price" value="<s:property value="inlayDiamondBo.pt950Price"/>" type="text" class="sous1" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))"/>
			</li>
			<br/><hr/><br/>
			<li>钻托默认图：<span style="color:red;">* </span><input type="file" name="picture" id="picture"/></li>
			<li>钻托相册图1：<input type="file" name="picture1" id="picture1"/></li>
			<li>钻托相册图2：<input type="file" name="picture2" id="picture2"/></li>
			<li>钻托相册图3：<input type="file" name="picture3" id="picture3"/></li>
			<li>钻托相册图4：<input type="file" name="picture4" id="picture4"/></li>
			<li>钻托相册图5：<input type="file" name="picture5" id="picture5"/></li>
			<li>钻托相册图6：<input type="file" name="picture6" id="picture6"/></li>
			<li>钻托相册图7：<input type="file" name="picture7" id="picture7"/></li>
			<li>钻托相册图8：<input type="file" name="picture8" id="picture8"/></li>
			<li>
				<label>
				<input type="image" src="<%=request.getContextPath()%>/stage/images/common/submit.gif" />
				</label>
			</li>
			<li>提示:<span style="color:red;" id="mess"></span></li>
		  </ul>
		  </form>
	   </div>
	 </div>
 </div>
<%@ include file="foot.jsp"%>
</div>
</body>
</html>
